package com.zff.rental.controller.dict;


import com.zff.rental.AppConstant;
import com.zff.rental.common.Result;
import com.zff.rental.service.dict.HouseTypeServer;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 户型字典
 *
 * @author HCY
 */
@RestController
@RequestMapping(AppConstant.RM_HOUSE_TYPE)
public class HouseTypeController {
    @Resource
    private HouseTypeServer houseTypeServer;

    /**
     * 添加户型
     */
    @GetMapping("/add")
    public Result<Boolean> add(@RequestParam("houseType") String params) {
        Boolean result = houseTypeServer.add(params);
        return Result.success(result);
    }

    /**
     * 删除户型
     */
    @GetMapping("/remove")
    public Result<Boolean> remove(@RequestParam("houseType") String id) {
        Boolean result = houseTypeServer.remove(id);
        return Result.success(result);
    }

    /**
     * 所有户型
     */
    @GetMapping("/list")
    public Result<List<String>> list() {
        List<String> result = houseTypeServer.list();
        return Result.success(result);
    }
}
